<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>循环</title>
	<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
	<script type="text/javascript">
		$(function () {
			// $('.list li').css({background:'gold'});
			$('.list li').each(function (index) {
				// body...
				$(this).html(index+1);
				// alert(index);
			})

		})
	</script>
</head>
<body>
	<ul class="list">
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
		<li></li>
	</ul>
</body>
</html>